package com.example.myapplication.until;

import android.app.Activity;
import com.example.myapplication.vo.Bird;
import com.example.myapplication.vo.Pig;

import java.util.ArrayList;
import java.util.List;

//这个与屏幕相绑定得出屏幕的大小
public class Globals {

    public static int SCREEN_WIDTH ;        //2208
    public static int SCREEN_HEIGH ;        //1080
    public static int RATE ;       //速率
    public static float PIECE_WIDTH  ; //将宽分成10块
    public static float PIECE_HEIGH  ; //将高分成6块
    public static List<Bird> BIRDLIST = new ArrayList();
    public static List<Pig> PIGLIST = new ArrayList();
    public static int SCORE = 0 ; //改到这里

    public static void init(Activity activity){
        //将activity的参数传进来来获取屏幕的大小
        SCREEN_WIDTH = activity.getWindowManager().getDefaultDisplay().getWidth() ;
        SCREEN_HEIGH = activity.getWindowManager().getDefaultDisplay().getHeight() ;

        RATE = 10 ; //兼容倍数

        PIECE_WIDTH = SCREEN_WIDTH/10f ;
        PIECE_HEIGH = SCREEN_HEIGH/6f ;

        System.out.println(SCREEN_WIDTH);
        System.out.println(SCREEN_HEIGH);
    }
}
